{extend name="template/base" /}
{block name="style"}
<link href="__LIB__/select2-4.0.3/dist/css/select2.min.css" rel="stylesheet" />
<link rel="stylesheet" href="__LIB__/webuploader/0.1.5/webuploader.css" />
<link rel="stylesheet" href="__LIB__/fontawesome-4.2.0_ie7/4.2.0/css/font-awesome.min.css" />
{/block}
{block name="content"}
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$vo.id ?? ''}">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">司机名称：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <p>{$vo.realname ?? '未填写'}</p>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">路线名称：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <p>{$vo.title ?? '未填写'}</p>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">出行日期：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <p>{php}echo $vo['go_date']? date('Y-m-d',$vo['go_date']) : '未填写'{/php}</p>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">下单金额合计：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <p>{$vo.order_total_money ?? '未填写'}</p>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">补缴合计：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <p>{$vo.other_conscience_money ?? '未填写'}</p>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">支出合计：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <p>{$vo.other_expenditure_money ?? '未填写'}</p>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">司陪房费用：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <p>{$vo.total_price ?? '未填写'}</p>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">酒店合计：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <p>{$vo.hotel_total ?? '未填写'}</p>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">司机费用支出合计：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <p>{$vo.this_settlement_money ?? '未填写'}</p>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">保险合计：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <p>{$vo.total_insurance_money ?? '未填写'}</p>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">毛利润：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <p>{php}echo $vo['order_total_money']+$vo['other_conscience_money']-$vo['other_expenditure_money']-$vo['total_price']-$vo['this_settlement_money']-$vo['hotel_total']-$vo['total_insurance_money']{/php}</p>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <hr style="margin-top: 20px;margin-bottom: 20px">
        <div>收入:</div>
        <table class="table table-border table-bordered table-hover table-bg mt-20">
            <thead>
            <tr class="text-c">
                <th width="">客人</th>
                <th width="">下单渠道</th>
                <th width="">下单金额</th>
                <th width="">下单金额合计</th>
                <th width="">补缴渠道</th>
                <th width="">补缴类目</th>
                <th width="">补缴金额</th>
                <th width="">补缴合计</th>
            </tr>
            </thead>
            <tbody>
            {volist name="vo.order_traveler" id="ot" key="k"}
            <tr class="text-c">
                <td>{$ot.name}</td>
                <td>{$ot.platform}</td>
                <td>{$ot.payment_fee}</td>
                {if condition="$k==1"}<td rowspan="{$vo.order_traveler_count}">{$vo.order_total_money}</td>{/if}
                <td><input type="text" class="input-text" placeholder="补缴渠道" name="order_info[{$ot.oid}][conscience_money_channel]" value="{$ot.conscience_money_channel}"></td>
                <td><input type="text" class="input-text" placeholder="补缴类目" name="order_info[{$ot.oid}][conscience_money_kind]" value="{$ot.conscience_money_kind}"></td>
                <td><input type="text" class="input-text" placeholder="补缴金额" name="order_info[{$ot.oid}][conscience_money]" value="{$ot.conscience_money}"></td>
                <!--<td><input type="text" class="input-text" placeholder="补缴渠道" name="conscience_money_channel[{$ot.oid}][]" value="{$ot.conscience_money_channel}"></td>-->
                <!--<td><input type="text" class="input-text" placeholder="补缴类目" name="conscience_money_kind[{$ot.oid}][]" value="{$ot.conscience_money_kind}"></td>-->
                <!--<td><input type="text" class="input-text" placeholder="补缴金额" name="conscience_money[{$ot.oid}][]" value="{$ot.conscience_money}"></td>-->
                {if condition="$k==1"}<td rowspan="{$vo.order_traveler_count}">{$vo.other_conscience_money}</td>{/if}
            </tr>
            {/volist}
            </tbody>
        </table>
        <hr style="margin-top: 20px;margin-bottom: 20px">
        <div>支出:</div>
        <table class="table table-border table-bordered table-hover table-bg mt-20">
            <thead>
            <tr class="text-c">
                <th width="">客人</th>
                <th width="">支出渠道</th>
                <th width="">支出类目</th>
                <th width="">支出金额</th>
                <th width="">支出合计</th>
                <th width="">司陪房费用</th>
                <th width="">入住酒店</th>
                <th width="">房款</th>
                <th width="">酒店合计</th>
                <th width="">实际结算司机费用</th>
                <th width="">扣其他费用</th>
                <th width="">司机费用支出合计</th>
                <th width="">司机保险</th>
                <th width="">游客保险</th>
                <th width="">保险合计</th>
            </tr>
            </thead>
            <tbody>
            {volist name="vo.order_traveler" id="ot" key="k"}
            <tr class="text-c">
                <td>{$ot.name}</td>
                <td><input type="text" class="input-text" placeholder="支出渠道" name="order_info[{$ot.oid}][expenditure_channel]" value="{$ot.expenditure_channel}"></td>
                <td><input type="text" class="input-text" placeholder="支出类目" name="order_info[{$ot.oid}][expenditure_kind]" value="{$ot.expenditure_kind}"></td>
                <td><input type="text" class="input-text" placeholder="支出金额" name="order_info[{$ot.oid}][expenditure_money]" value="{$ot.expenditure_money}"></td>
                <!--<td><input type="text" class="input-text" placeholder="支出渠道" name="expenditure_channel[{$ot.oid}][]" value="{$ot.expenditure_channel}"></td>-->
                <!--<td><input type="text" class="input-text" placeholder="支出类目" name="expenditure_kind[{$ot.oid}][]" value="{$ot.expenditure_kind}"></td>-->
                <!--<td><input type="text" class="input-text" placeholder="支出金额" name="expenditure_money[{$ot.oid}][]" value="{$ot.expenditure_money}"></td>-->
                {if condition="$k==1"}<td rowspan="{$vo.order_traveler_count}">{$vo.other_expenditure_money}</td>{/if}
                {if condition="$k==1"}<td rowspan="{$vo.order_traveler_count}"><input type="text" class="input-text" placeholder="司陪房费用" name="total_price" value="{$vo.total_price}"></td>{/if}
                {if condition="$k==1"}<td style="padding: 0;" rowspan="{$vo.order_traveler_count}">
                <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">
                    {volist name="vo.hotel" id="h"}
                    <tr>
                        <td>{$h.hotel_name}</td>
                    </tr>
                    {/volist}
                </table>
                </td>{/if}
                {if condition="$k==1"}<td style="padding: 0;" rowspan="{$vo.order_traveler_count}">
                <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">
                    {volist name="vo.hotel" id="h"}
                    <tr>
                        <td><input type="text" class="input-text" placeholder="房款" name="hotel_price[{$h.id}]" value="{$h.total_price}"></td>
                    </tr>
                    {/volist}
                </table>
                </td>{/if}
                {if condition="$k==1"}<td rowspan="{$vo.order_traveler_count}">{$vo.hotel_total}</td>{/if}
                {if condition="$k==1"}<td rowspan="{$vo.order_traveler_count}"><input type="text" class="input-text" placeholder="实际结算司机费用" name="this_settlement_money" value="{$vo.this_settlement_money}"></td>{/if}
                {if condition="$k==1"}<td rowspan="{$vo.order_traveler_count}"><input type="text" class="input-text" placeholder="扣其他费用" name="other_deduct_money" value="{$vo.other_deduct_money}"></td>{/if}
                {if condition="$k==1"}<td rowspan="{$vo.order_traveler_count}"><input type="text" class="input-text" placeholder="司机费用支出合计" name="this_settlement_money" value="{$vo.this_settlement_money}"></td>{/if}
                {if condition="$k==1"}<td rowspan="{$vo.order_traveler_count}"><input type="text" class="input-text" placeholder="司机保险" name="insurance_money" value="{$vo.insurance_money}"></td>{/if}
                <td>{$ot.insurance_money}</td>
                {if condition="$k==1"}<td rowspan="{$vo.order_traveler_count}">{$vo.total_insurance_money}</td>{/if}
            </tr>
            {/volist}
            </tbody>
        </table>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__LIB__/webuploader/0.1.5/webuploader.js"></script>
<script type="text/javascript" src="__LIB__/webuploader/0.1.5/image-upload/uploadimg.js"></script>
<!--select2 js 插件-->
<script type="text/javascript" src="__LIB__/select2-4.0.3/dist/js/select2.min.js"></script>
<script>
    $(function () {

        upload_imgs("head_img");

        var id = $("#id").select2({
            language: "zh-CN", //设置 提示语言
            width: "100%", //设置下拉框的宽度
            theme: "classic"
        });
        {notempty name = "vo['user_id']"}
        id.val("{$vo['user_id']}").trigger("change");
        {/notempty}

            var rank_id = $("#rank_id").select2({
                language: "zh-CN", //设置 提示语言
                width: "100%", //设置下拉框的宽度
                theme: "classic"
            });
            {notempty name = "vo['rank_id']"}
                rank_id.val("{$vo['rank_id']}").trigger("change");
            {/notempty}

        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret){
                ajax_progress(ret);
            }
        });
    })
</script>
{/block}
